<%# Copyright 2009 Swansea University

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
%>

<% title "Your Projects" %>

<% slogan "&ldquo;Nice work if you can get it, and you can get it if you try&rdquo; &ndash; Ira Gershwin (1896&mdash;1983)." %>

<% if @user.supervisor? %>
  <!-- Staff page -->
   <p>Dear <%= @user.name.formally %>,</p>
   <% if @projects.empty? %>
    <p>You do not appear to have created any projects yet. <%= link_to "Create one now? ", new_user_project_path %>.
  <% else %>
    <p>Here is your current list of projects.</p>
    <table id="projects">
      <thead>
        <th>Number</th>
        <th>Title</th>
        <th colspan="3">Actions</th>
      </thead>
      <tbody>
        <%= render(:partial => "project_index", :collection => @projects) %>
      </tbody>
    </table>
    <p><%= link_to "New project", new_user_project_path %>.</p>

    <p>Until <%= proman %> is open to students
      for project selection, you are free and encouraged to edit, your project
      descriptions and add new ones. However, please be aware of the
      requirements of the School and your research centre's project coordinator. It
      would help if you could refine the disciplines for your projects and indicate if
      your project would be suitable for consideration under the Atkins Carbon Critical
    (C<sup>2</sup>) award or the Swansea University Racecar Engineering (SURE) team.</p>
  <% end %>
<% elsif @user.student? %>
  <!-- Student page -->
  <p>When the project allocation is complete, this page will show the details of your project,
  supervisor and associated research centre. For now, you can <% link_to "browse the available projects", projects_path %>.
<% end %>